import Vue from 'vue'
import VueRouter from 'vue-router'
import Layout from '../views/Layout.vue'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    name: 'Layout',
    // redirect: '/welcome',
    component: Layout,
    children: [
      {
        path: '/Button',
        name: 'Button',
        component: () =>
          import(
            /* webpackChunkName: "Button" */ '../views/general/Button.vue'
          ),
      },
      {
        path: '/Icon',
        name: 'Icon',
        component: () =>
          import(/* webpackChunkName: "Icon" */ '../views/general/Icon.vue'),
      },
    ],
  },
]

const router = new VueRouter({
  mode: 'history',
  // base: process.env.BASE_URL,
  base: import.meta.env.BASE_URL,
  routes,
})

export default router
